package datastructure;

/**
 * Author: Jason Wu
 * Date  : 2013-12-02
 */
public class DequeueThread implements Runnable {
    private BlockingQueue blockingQueue;

    private boolean running = true;

    public DequeueThread(BlockingQueue blockingQueue) {
        this.blockingQueue = blockingQueue;
    }

    @Override
    public void run() {
        try {
            while (true) {
                PushTask pushTask = (PushTask) blockingQueue.dequeue();
                pushTask.run();
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
